#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   DTC_test.py
@Time    :   2024/08/21 13:31:28
@Author  :   YangLiang 
@Version :   1.0
@Contact :   yangliang@chengtech.com
@License :   (C)Copyright 2022-2025
@Desc    :   None
'''

# here put the import lib
from cgitb import enable
from email.message import Message
from pytest_assume.plugin import assume
 
import pytest
import binascii
import logging
import time
import requests
from sympy import I
# from sympy import assuming
from commDriver.TS_CAN import *
import allure
import sys
from collections.abc import Iterable

from sqlalchemy import false
sys.dont_write_bytecode = True
import Set_up

Fault_Injection_DTC_List = [([0xAC, 0xE8, 0x76], 'SensorBlindnessDet'),
                            ([0xAC, 0xE9, 0x76], 'SensorBlindnessDet'),
                            ([0xAC, 0xE6, 0x55], 'VariantCodeDet'),
                            ([0xAC, 0xD1, 0x78], 'AlignmentNeverDone'),
                            ([0xAC, 0xD2, 0x78], 'AlignmentNotDone'),
                            ([0xAC, 0xEA, 0x94], 'VerticalMisaligment'),
                            ([0xAC, 0xEB, 0x94], 'HorizontalMisaligment'),
                            ([0xAC, 0xD4, 0x88], 'FactoryDataFail'),
                            ([0xAC, 0xD9, 0x17], 'Rd3_3OV'),
                            ([0xAC, 0xDB, 0x16], 'Rd3_3UV'),
                            ([0xAC, 0xDE, 0x00], 'RadarModulation'),
                            ([0xAC, 0xE1, 0x52], 'SwTempFail'),
                            ([0xAC, 0xE2, 0x4B], 'MasterRdTemp'),  # PASS与FAIL状态不是0与-1.需要输入具体数值
                            ([0xAC, 0xED, 0x00], 'AntDiagram'),
                            ([0xAC, 0xD6, 0x40], 'Watchdog'),                #内部电源管理系统故障 new
                            ([0xAC, 0xD8, 0x04], 'internalHw'),                #内部硬件故障 new
                            ([0xAC, 0xDD, 0x00], 'radarModCfg'),                #雷达调制配置故障 new
                            ([0xAC, 0xDF, 0x52], 'swFail'),                #软件故障 new
                            ([0xAC, 0xE0, 0x00], 'basebandFail'),                #雷达前端数据处理故障 new
                            ]




@allure.severity('critical')
class Test_DTC_Phy(object):

    def clearDTC(self, Driver, iStep,checkinitialized=True):
        # 清除DTC故障
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 0, iStep, False, 'UDS', 'noClearFault')
        time.sleep(2)
        if checkinitialized:
            iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 0, iStep, False, 'UDS', 'noClearFault')
            iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        return iStep

    def searchDTC(self, Driver,req, DTC_Number,iStep, isTrue, MatureConditionsTime=1000, timeout=0.5):
        # 查询故障
        with allure.step(f"Step{iStep}: search DTC {binascii.b2a_hex(bytearray(DTC_Number), ' ')}"):
            time.sleep(MatureConditionsTime/1000)
            a,b,c=Driver['UDS'].search_DTC(req, DTC_Number, timeout)
            if isTrue:
                if (b + MatureConditionsTime/1000) > (MatureConditionsTime/1000 + 0.15):
                    logging.error(f"MatureConditionsTime = {MatureConditionsTime/1000 + 0.1}s, realtime = {b + MatureConditionsTime/1000}s")
                if a != True:
                    logging.error(f"No found DTC{binascii.b2a_hex(bytearray(DTC_Number), ' ')}")
                with assume: assert a == True and (b + MatureConditionsTime/1000) <= (MatureConditionsTime/1000 + 0.1)
            else:
                with assume: assert a == False
            iStep +=1
        return iStep

    '''设置信号使能状态'''
    def setSignalEanble(self, Driver, message, status, iStep):
        with allure.step(f'Step{iStep}: set the {message} status to {status}'):
            Driver['CAN'].Enable_rbs_message('MRR',Set_up.nodeName, message, status)
        iStep += 1
        return iStep


    '''设置信号值'''
    def setSignalValue(Self, Driver, message, signal, value, iStep):
        with allure.step(f'Step{iStep}: set the value of the {signal} in {message} to {value}'):
            Driver['CAN'].write_db_signal('MRR',Set_up.nodeName, message, signal, value)
            time.sleep(0.2)
            iStep += 1
            readValue = Driver['CAN'].read_db_signal('MRR',Set_up.nodeName, message, signal)
        return iStep
            

    def checkDTC(self, Driver, DTCNumber, message, cycleTime, missCount, iStep, signal='', faultValue=0, normalValue=0, settype='enable', DtcExist = True):
        req = [0x19,0x02,0x09]

        DTC_Number_Exist = DTCNumber + [0x09]
        DTC_Number_NoExist = DTCNumber + [0x08]

        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1001', '5001', 0, iStep)
        iStep = self.clearDTC(Driver, iStep)
        time.sleep(1.5)

        if settype == 'enable':
            # 停发报文
            iStep = self.setSignalEanble(Driver,message, False,iStep)
            if message == 'MPC_0x374':
                iStep = self.setSignalEanble(Driver,'MPC_0x295', False,iStep)
                readValue = Driver['CAN'].read_db_signal('MRR',Set_up.nodeName, 'Left_BCM_0x12D', 'BCMPower_Gear_12D_S')
                readValue = Driver['CAN'].read_db_signal('MRR',Set_up.nodeName, 'Left_BCM_0x3D9', 'Total_Distance_3D9s5_S')
            if message == 'MPC_0x295':
                iStep = self.setSignalEanble(Driver,'MPC_0x374', False,iStep)
                readValue = Driver['CAN'].read_db_signal('MRR',Set_up.nodeName, 'Left_BCM_0x12D', 'BCMPower_Gear_12D_S')
                readValue = Driver['CAN'].read_db_signal('MRR',Set_up.nodeName, 'Left_BCM_0x3D9', 'Total_Distance_3D9s5_S')

        else:
            iStep = self.setSignalValue(Driver, message, signal, faultValue, iStep)
        # 查询故障是否已经产生
        iStep = self.searchDTC(Driver, req, DTC_Number_Exist, iStep, DtcExist, cycleTime * missCount + 100)

        if settype == 'enable':
            # 停发报文
            iStep = self.setSignalEanble(Driver,message, True,iStep)
        else:
            iStep = self.setSignalValue(Driver, message, signal, normalValue, iStep)
        # 查询故障是否已经恢复
        iStep = self.searchDTC(Driver, req, DTC_Number_NoExist, iStep, DtcExist, cycleTime + 100, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number_NoExist, iStep, DtcExist, 100, 1)
        iStep = self.clearDTC(Driver, iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number_NoExist, iStep, False, 100, 1)

        return iStep

    @allure.title('Test DTC_VBAT_HIGH in default session')
    @allure.description('Test DTC_VBAT_HIGH in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VBAT_HIGH_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xAC,0xCE,0x17]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        iStep = self.clearDTC(Driver, iStep)
        iStep = Driver['CAN'].SetVolt(Driver, 17, 0.5, iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 1000)

        iStep = Driver['CAN'].SetVolt(Driver, 12, 0.5, iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 1000)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)
        iStep = self.clearDTC(Driver, iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_VBAT_HIGH boundary value generate DTC code in default session')
    @allure.description('Test DTC_VBAT_HIGH boundary value generate DTC code in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VBAT_HIGH_boundary_DTC_Phy(self,action,BCMPower_Gear,Driver):
        iStep = 1
        req = [0x19,0x02,0x09]
        DTC_Number_Exist = [0xAC,0xCE,0x17,0x09]
        DTC_Number_NoExist = [0xAC,0xCE,0x17,0x08]

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 无故障到有故障
        for i in range(6):
            voltage = 16.0 + i/10
            iStep = self.clearDTC(Driver, iStep,False)
            iStep = Driver['CAN'].SetVolt(Driver, voltage, 0.5, iStep)
            if voltage > 16.3:
                iStep = self.searchDTC(Driver, req, DTC_Number_Exist, iStep, True, 1000)
        iStep = Driver['CAN'].SetVolt(Driver, voltage, 1, iStep)
        # 有故障到无故障
        for i in range(5):
            voltage = 16.5 - i/10
            iStep = self.clearDTC(Driver, iStep,False)
            iStep = Driver['CAN'].SetVolt(Driver, voltage, 0.5, iStep)
            if voltage > 16.3:
                iStep = self.searchDTC(Driver, req, DTC_Number_Exist, iStep, True, 1000)
        
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep = self.clearDTC(Driver, iStep)

    @allure.title('Test DTC_VBAT_LOW in default session')
    @allure.description('Test DTC_VBAT_LOW in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VBAT_LOW_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xAC,0xCF,0x16]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        iStep = self.clearDTC(Driver, iStep)
        # 设置电压为8v 制造低压故障
        iStep = Driver['CAN'].SetVolt(Driver, 8, 0.5, iStep)
        # 查询低压故障是否已经产生
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 1000)
        # 恢复电压为13v
        iStep = Driver['CAN'].SetVolt(Driver, 12, 0.5, iStep)
        # 查询故障是否已经恢复
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 1000)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)
        iStep = self.clearDTC(Driver, iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_VBAT_LOW boundary value generate DTC code in default session')
    @allure.description('Test DTC_VBAT_LOW boundary DTC in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VBAT_LOW_boundary_DTC_Phy(self,action,BCMPower_Gear,Driver):

        req = [0x19,0x02,0x09]
        DTC_Number_Exist = [0xAC,0xCF,0x16,0x09]
        DTC_Number_NoExist = [0xAC,0xCF,0x16,0x08]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        # 无故障到有故障
        for i in range(6):
            voltage = 8.9 - i/10
            
            iStep = Driver['CAN'].SetVolt(Driver, 12, 0.5, iStep)
            iStep = self.clearDTC(Driver, iStep)
            time.sleep(0.5)
            iStep = Driver['CAN'].SetVolt(Driver, voltage, 0.5, iStep)
            if voltage < 8.6:
                iStep = self.searchDTC(Driver, req, DTC_Number_Exist, iStep, True, 1000)
        
        # 有故障到无故障
        for i in range(6):
            voltage = 8.3 + i/10
            iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
            iStep = self.clearDTC(Driver, iStep)
            time.sleep(1)
            iStep = Driver['CAN'].SetVolt(Driver, voltage, 0.5, iStep)
            if voltage < 8.6:
                iStep = self.searchDTC(Driver, req, DTC_Number_Exist, iStep, True, 1000)
        
        iStep = Driver['CAN'].SetVolt(Driver, 12, 0.5, iStep)
        iStep = self.clearDTC(Driver, iStep)

    @allure.title('Test DTC_SFCAN_BUSOFF in default session')
    @allure.description('Test DTC_SFCAN_BUSOFF in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_SFCAN_BUSOFF_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xC1,0xD7,0x88]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].S_ConnectCanH_CanL(True, iStep)
        Driver['CAN'].S_ConnectCanH_CanL(False, iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 300, 1)
        time.sleep(0.2)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)   
    

    @allure.title('Test DTC_PRODUCTION_MODE_ACTIVE in default session')
    @allure.description('Test DTC_PRODUCTION_MODE_ACTIVE in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_PRODUCTION_MODE_ACTIVE_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xAC,0xD0,0x00]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        
        # 更改模式为生产模式
        with allure.step(f'Step{iStep}: set production mode is factory mode'):
            iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '2E340101', '6E3401', 3, iStep, True)
            iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '223401', '62340101', 0, iStep, False)

        # 查询故障是否已经产生
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 1000)
        # 更改模式为正常模式
        with allure.step(f'Step{iStep}: set production mode is normal mode'):
            iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '2E340100', '6E3401', 3, iStep, True)
            iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '223401', '62340100', 0, iStep, False)
        # 查询故障是否已经恢复
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 1000)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)
        iStep = self.clearDTC(Driver, iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    '''故障注入测试'''
    ids = ["Request {0}".format(binascii.b2a_hex(bytearray(req), ' '), dtcName ) for req, dtcName in Fault_Injection_DTC_List]
    @allure.title('Test Injection_DTC in default session')
    @allure.description('Test Injection_DTC in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    @pytest.mark.parametrize('req,dtcName', Fault_Injection_DTC_List, ids=ids)
    def test_Injection_DTC_Default_Phy(self, action,BCMPower_Gear, Driver, req, dtcName):
        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        iStep = Driver['CAN'].setVariantCodeDet(Driver,dtcName, -1, iStep)
        time.sleep(0.5)
        if req == [0xAC, 0XE8, 0X76]:
            # 要求行驶里程大于5公里
            Driver['CAN'].write_db_signal('MRR', Set_up.nodeName, 'Left_BCM_0x3D9', 'Total_Distance_3D9s5_S',10)
            Driver['CAN'].write_db_signal('MRR', Set_up.nodeName, 'IPB_0x121', 'IPB_Vehicle_Speed_S', 20)
            Driver['CAN'].read_db_signal('MRR', Set_up.nodeName, 'IPB_0x121', 'IPB_Vehicle_Speed_S')
            time.sleep(1)
            Driver['CAN'].write_db_signal('MRR', Set_up.nodeName, 'Left_BCM_0x3D9', 'Total_Distance_3D9s5_S',16)

        a,b,c=Driver['UDS'].search_DTC([0x19,0x02,0x09], req + [0x09])
        if a != True:
            logging.error(f"No found DTC{binascii.b2a_hex(bytearray(req + [0x09]), ' ')}")
        with assume: assert a == True

        iStep = Driver['CAN'].setVariantCodeDet(Driver,dtcName, 0,iStep)
        if req == [0xAC, 0XE8, 0X76]:
            Driver['CAN'].write_db_signal('MRR', Set_up.nodeName, 'Left_BCM_0x3D9', 'Total_Distance_3D9s5_S',0)
            Driver['CAN'].write_db_signal('MRR', Set_up.nodeName, 'IPB_0x121', 'IPB_Vehicle_Speed_S', 0)
            Driver['CAN'].read_db_signal('MRR', Set_up.nodeName, 'IPB_0x121', 'IPB_Vehicle_Speed_S')
        time.sleep(0.5)
        a,b,c=Driver['UDS'].search_DTC([0x19,0x02,0x09], req + [0x08])
        if a != True:
            logging.error(f"DTC [{binascii.b2a_hex(bytearray(req + [0x08]), ' ')}] not recovered")
        with assume: assert a == True

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        if req == [0xAC, 0xE6, 0x55] or req == [0xAC, 0xD1, 0x78] or req == [0xAC, 0xD2, 0x78]:
            a,b,c=Driver['UDS'].search_DTC([0x19,0x02,0x09], req + [0x08],timeout=1)
            if a == False:
                a,b,c=Driver['UDS'].search_DTC([0x19,0x02,0x09], req + [0x09],timeout=1)
        else:
            a,b,c=Driver['UDS'].search_DTC([0x19,0x02,0x09], req + [0x08],timeout=1)
        if a != True:
            logging.error(f"Restart Device DTC [{binascii.b2a_hex(bytearray(req), ' ')}] is not saved")
        with assume: assert a == True and b <= 1

        uds_rep,size = Driver['UDS'].req_and_res_can([0x14,0xFF,0xFF,0xFF],4)
        with assume: assert uds_rep[0] == 0x54
        time.sleep(1.5)
        a,b,c=Driver['UDS'].search_DTC([0x19,0x02,0x09], req + [0x08],timeout=1)
        with assume: assert a == False

    
    @allure.title('Test DTC_Left_BCM_TIMEOUT by lost 0x12D message in default session')
    @allure.description('Test DTC_Left_BCM_TIMEOUT by lost 0x12D message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Left_BCM_TIMEOUT_0x12D_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0xA8, 0x87]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'Left_BCM_0x12D', 50, 10, iStep)
    
    @allure.title('Test DTC_Left_BCM_TIMEOUT by lost 0x151 message in default session')
    @allure.description('Test DTC_Left_BCM_TIMEOUT by lost 0x151 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Left_BCM_TIMEOUT_0x151_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0xA8, 0x87]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'Left_BCM_0x151', 100, 10, iStep)


    @allure.title('Test DTC_Left_BCM_TIMEOU by lost 0x3D9 message in default session')
    @allure.description('Test DTC_Left_BCM_TIMEOU by lost 0x3D9 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Left_BCM_TIMEOU_0x3D9_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0xA8, 0x87]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'Left_BCM_0x3D9', 1000, 5, iStep)

    @allure.title('Test DTC_Left_BCM_CRC by 0x151 Checksum Error in default session')
    @allure.description('Test DTC_Left_BCM_CRC by 0x151 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Left_BCM_CRC_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x67,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x151_checksum_error(True)
        # 10次 10*100ms = 1000ms
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 1050, 1)

        Driver['CAN'].set_0x151_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 65, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_Left_BCM_ALC by 0x151 RollingCounter Error in default session')
    @allure.description('Test DTC_Left_BCM_ALC by 0x151 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Left_BCM_ALC_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x66,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x151_rolling_counter_error(True)
        #10次 100ms*10=1000ms 增加一帧的延时
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 1050, 1)

        Driver['CAN'].set_0x151_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 65, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    
    @allure.title('Test DTC_Left_BCM_Signal_Invalid in default session')
    @allure.description('Test DTC_Left_BCM_Signal_Invalid in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Left_BCM_Signal_Invalid_Default_Phy(self,action,Driver):
        DTCNumber = [0x5C, 0x65, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'Left_BCM_0x151', 100, 10, iStep, 'Speed_Signal_151_S', 0xFF, 0, 'value')

    
    @allure.title('Test DTC_Rear_BCM_TIMEOUT by lost 0x218 message in default session')
    @allure.description('Test DTC_Rear_BCM_TIMEOUT by lost 0x218 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Rear_BCM_TIMEOUT_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xD0, 0x03, 0x04]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'Rear_BCM_0x218', 20, 10, iStep)
    
    @allure.title('Test DTC_Rear_BCM_CRC by 0x218 Checksum Error in default session')
    @allure.description('Test DTC_Rear_BCM_CRC by 0x218 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Rear_BCM_CRC_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x49,0x00]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x218_checksum_error(True)
        # 10次 10*20ms = 200ms
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x218_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    
    @allure.title('Test DTC_Rear_BCM_ALC by 0x218 RollingCounter Error in default session')
    @allure.description('Test DTC_Rear_BCM_ALC by 0x218 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Rear_BCM_ALC_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x36,0x82]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x218_rolling_counter_error(True)
        #10次 100ms*10=1000ms 增加一帧的延时
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x218_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    
    @allure.title('Test DTC_Rear_BCM_Signal_Invalid in default session')
    @allure.description('Test DTC_Rear_BCM_Signal_Invalid in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Rear_BCM_Signal_Invalid_Default_Phy(self,action,Driver):
        DTCNumber = [0xD1, 0x7B, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'Rear_BCM_0x218', 20, 10, iStep, 'EPB_Status_S', 0x04, 0, 'value')

    
    @allure.title('Test DTC_Right_BCM_TIMEOUT by lost 0x404 message in default session')
    @allure.description('Test DTC_Right_BCM_TIMEOUT by lost 0x404 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Right_BCM_TIMEOUT_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0xE9, 0x87]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'Right_BCM_0x404', 1000, 5, iStep)

    
    @allure.title('Test DTC_Right_BCM_ALC by 0x404 RollingCounter Error in default session')
    @allure.description('Test DTC_Right_BCM_ALC by 0x404 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Right_BCM_ALC_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xC1,0xE3,0x82]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x404_rolling_counter_error(True)
        #10次 1000ms*10=10000ms 增加一帧的延时
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 10000, 1)

        Driver['CAN'].set_0x404_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 1000, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    
    @allure.title('Test DTC_Media_TIMEOUT by lost 0x2B6 message in default session')
    @allure.description('Test DTC_Media_TIMEOUT by lost 0x2B6 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Media_TIMEOUT_0x2B6_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC2, 0x45, 0x00]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'Media_0x2B6', 500, 5, iStep)

    @allure.title('Test DTC_Media_TIMEOUT by lost 0x49A message in default session')
    @allure.description('Test DTC_Media_TIMEOUT by lost 0x49A message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Media_TIMEOUT_0x49A_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC2, 0x45, 0x00]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'LTE4G_0x49A', 1000, 5, iStep)

    
    @allure.title('Test DTC_Media_CRC by 0x49A Checksum Error in default session')
    @allure.description('Test DTC_Media_CRC by 0x49A Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_Media_CRC_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xC2,0xED,0x83]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x49A_checksum_error(True)
        # 10次 10*1000ms = 10000ms 增加一帧的延时
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 10000, 1)

        Driver['CAN'].set_0x49A_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 1000, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_VCU_TIMEOUT by lost 0x342 message in default session')
    @allure.description('Test DTC_VCU_TIMEOUT by lost 0x342 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VCU_TIMEOUT_0x342_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xD0, 0xC2, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'VCU_0x342', 20, 10, iStep)

    @allure.title('Test DTC_VCU_TIMEOUT by lost 0x242 message in default session')
    @allure.description('Test DTC_VCU_TIMEOUT by lost 0x242 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VCU_TIMEOUT_0x242_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xD0, 0xC2, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'VCU_0x242', 20, 10, iStep)

    @allure.title('Test DTC_VCU_CRC by 0x240 Checksum Error in default session')
    @allure.description('Test DTC_VCU_CRC by 0x240 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VCU_CRC_0x240_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xD2,0x71,0x83]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x240_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 1000, 1)

        Driver['CAN'].set_0x240_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_VCU_CRC by 0x242 Checksum Error in default session')
    @allure.description('Test DTC_VCU_CRC by 0x242 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VCU_CRC_0x242_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xD2,0x71,0x83]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x242_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x242_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_VCU_CRC by 0x341 Checksum Error in default session')
    @allure.description('Test DTC_VCU_CRC by 0x341 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VCU_CRC_0x341_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xD2,0x71,0x83]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x341_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 500, 1)

        Driver['CAN'].set_0x341_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 50, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    
    @allure.title('Test DTC_VCU_CRC by 0x342 Checksum Error in default session')
    @allure.description('Test DTC_VCU_CRC by 0x342 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VCU_CRC_0x342_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xD2,0x71,0x83]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x342_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x342_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_VCU_ALC by 0x242 RollingCounter Error in default session')
    @allure.description('Test DTC_VCU_ALC by 0x242 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VCU_ALC_0x242_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xD2,0x71,0x82]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x242_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x242_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1) 

    @allure.title('Test DTC_VCU_ALC by 0x342 RollingCounter Error in default session')
    @allure.description('Test DTC_VCU_ALC by 0x342 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_VCU_ALC_0x342_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xD2,0x71,0x82]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x342_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x342_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1) 

    @allure.title('Test DTC_IPB_TIMEOUT by lost 0x121 message in default session')
    @allure.description('Test DTC_IPB_TIMEOUT by lost 0x121 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_TIMEOUT_0x121_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x97, 0x80]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x121', 20, 10, iStep)

    @allure.title('Test DTC_IPB_TIMEOUT by lost 0x123 message in default session')
    @allure.description('Test DTC_IPB_TIMEOUT by lost 0x123 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_TIMEOUT_0x123_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x97, 0x80]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x123', 10, 10, iStep)

    @allure.title('Test DTC_IPB_TIMEOUT by lost 0x222 message in default session')
    @allure.description('Test DTC_IPB_TIMEOUT by lost 0x222 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_TIMEOUT_0x222_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x97, 0x80]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x222', 20, 10, iStep)

    @allure.title('Test DTC_IPB_TIMEOUT by lost 0x223 message in default session')
    @allure.description('Test DTC_IPB_TIMEOUT by lost 0x223 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_TIMEOUT_0x223_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x97, 0x80]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x223', 20, 10, iStep)

    @allure.title('Test DTC_IPB_TIMEOUT by lost 0x321 message in default session')
    @allure.description('Test DTC_IPB_TIMEOUT by lost 0x321 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_TIMEOUT_0x321_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x97, 0x80]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x321', 20, 10, iStep)

    @allure.title('Test DTC_IPB_TIMEOUT by lost 0x220 message in default session')
    @allure.description('Test DTC_IPB_TIMEOUT by lost 0x220 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_TIMEOUT_0x220_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x97, 0x80]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x220', 20, 10, iStep)

    @allure.title('Test DTC_IPB_TIMEOUT by lost 0x422 message in default session')
    @allure.description('Test DTC_IPB_TIMEOUT by lost 0x422 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_TIMEOUT_0x422_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x97, 0x80]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x422', 20, 10, iStep)

    @allure.title('Test DTC_IPB_TIMEOUT by lost 0x1F0 message in default session')
    @allure.description('Test DTC_IPB_TIMEOUT by lost 0x1F0 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_TIMEOUT_0x1F0_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x97, 0x80]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x1F0', 20, 10, iStep)

    @allure.title('Test DTC_IPB_TIMEOUT by lost 0x0D5 message in default session')
    @allure.description('Test DTC_IPB_TIMEOUT by lost 0x0D5 message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_TIMEOUT_0x0D5_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x97, 0x80]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x0D5', 10, 10, iStep)

    
    @allure.title('Test DTC_IPB_CRC by 0x121 Checksum Error in default session')
    @allure.description('Test DTC_IPB_CRC by 0x121 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_CRC_0x121_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x64,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 制造故障 
        Driver['CAN'].set_0x121_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)
        # 恢复故障
        Driver['CAN'].set_0x121_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_CRC by 0x123 Checksum Error in default session')
    @allure.description('Test DTC_IPB_CRC by 0x123 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_CRC_0x123_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x64,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 制造故障 
        Driver['CAN'].set_0x123_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 100, 1)
        # 恢复故障
        Driver['CAN'].set_0x123_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 10, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_CRC by 0x1F0 Checksum Error in default session')
    @allure.description('Test DTC_IPB_CRC by 0x1F0 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_CRC_0x1F0_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x64,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 制造故障 
        Driver['CAN'].set_0x1F0_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)
        # 恢复故障
        Driver['CAN'].set_0x1F0_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_CRC by 0x220 Checksum Error in default session')
    @allure.description('Test DTC_IPB_CRC by 0x220 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_CRC_0x220_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x64,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 制造故障 
        Driver['CAN'].set_0x220_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)
        # 恢复故障
        Driver['CAN'].set_0x220_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_CRC by 0x222 Checksum Error in default session')
    @allure.description('Test DTC_IPB_CRC by 0x222 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_CRC_0x222_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x64,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 制造故障 
        Driver['CAN'].set_0x222_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)
        # 恢复故障
        Driver['CAN'].set_0x222_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)
    
    @allure.title('Test DTC_IPB_CRC by 0x223 Checksum Error in default session')
    @allure.description('Test DTC_IPB_CRC by 0x223 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_CRC_0x223_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x64,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 制造故障 
        Driver['CAN'].set_0x223_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)
        # 恢复故障
        Driver['CAN'].set_0x223_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)
    
    @allure.title('Test DTC_IPB_CRC by 0x321 Checksum Error in default session')
    @allure.description('Test DTC_IPB_CRC by 0x321 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_CRC_0x321_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x64,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 制造故障 
        Driver['CAN'].set_0x321_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)
        # 恢复故障
        Driver['CAN'].set_0x321_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)
    
    @allure.title('Test DTC_IPB_CRC by 0x422 Checksum Error in default session')
    @allure.description('Test DTC_IPB_CRC by 0x422 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_CRC_0x422_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x64,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 制造故障 
        Driver['CAN'].set_0x422_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)
        # 恢复故障
        Driver['CAN'].set_0x422_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_CRC by 0x0D5 Checksum Error in default session')
    @allure.description('Test DTC_IPB_CRC by 0x0D5 Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_CRC_0x0D5_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x64,0x62]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        # 制造故障 
        Driver['CAN'].set_0x0D5_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 100, 1)
        # 恢复故障
        Driver['CAN'].set_0x0D5_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 10, 1)
        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_ALC by 0x1F0 RollingCounter Error in default session')
    @allure.description('Test DTC_IPB_ALC by 0x1F0 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_ALC_0x1F0_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x63,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x1F0_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x1F0_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_ALC by 0x121 RollingCounter Error in default session')
    @allure.description('Test DTC_IPB_ALC by 0x121 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_ALC_0x121_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x63,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x121_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x121_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_ALC by 0x0D5 RollingCounter Error in default session')
    @allure.description('Test DTC_IPB_ALC by 0x0D5 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_ALC_0x0D5_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x63,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x0D5_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 100, 1)

        Driver['CAN'].set_0x0D5_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 10, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_ALC by 0x123 RollingCounter Error in default session')
    @allure.description('Test DTC_IPB_ALC by 0x123 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_ALC_0x123_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x63,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x123_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 100, 1)

        Driver['CAN'].set_0x123_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 10, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_ALC by 0x220 RollingCounter Error in default session')
    @allure.description('Test DTC_IPB_ALC by 0x220 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_ALC_0x220_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x63,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x220_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x220_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_ALC by 0x222 RollingCounter Error in default session')
    @allure.description('Test DTC_IPB_ALC by 0x222 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_ALC_0x222_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x63,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x222_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x222_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_ALC by 0x223 RollingCounter Error in default session')
    @allure.description('Test DTC_IPB_ALC by 0x223 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_ALC_0x223_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x63,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x223_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x223_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_ALC by 0x321 RollingCounter Error in default session')
    @allure.description('Test DTC_IPB_ALC by 0x321 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_ALC_0x321_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x63,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x321_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x321_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_ALC by 0x422 RollingCounter Error in default session')
    @allure.description('Test DTC_IPB_ALC by 0x422 RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_ALC_0x422_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0x5C,0x63,0x02]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x422_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x422_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_IPB_Signal_Invalid by Yaw_Rate_Signal_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by Yaw_Rate_Signal_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_YawRateSignalS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x222', 20, 10, iStep, 'Yaw_Rate_Signal_S', 2.096, 0, 'value')

    @allure.title('Test DTC_IPB_Signal_Invalid by Yaw_Rate_Status_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by Yaw_Rate_Status_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_YawRateStatusS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x222', 20, 10, iStep, 'Yaw_Rate_Status_S', 0, 1, 'value')

    @allure.title('Test DTC_IPB_Signal_Invalid by IPB_AX_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by IPB_AX_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_IPBAXS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x223', 20, 10, iStep, 'IPB_AX_S', 22, 0, 'value')
    
    @allure.title('Test DTC_IPB_Signal_Invalid by IPB_AX_Status_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by IPB_AX_Status_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_IPBAXStatusS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x223', 20, 10, iStep, 'IPB_AX_Status_S', 0,1, 'value')

    @allure.title('Test DTC_IPB_Signal_Invalid by IPB_AY_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by IPB_AY_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_IPBAYS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x223', 20, 10, iStep, 'IPB_AY_S', 22, 0, 'value')
    
    @allure.title('Test DTC_IPB_Signal_Invalid by IPB_AY_Status_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by IPB_AY_Status_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_IPBAYStatusS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x223', 20, 10, iStep, 'IPB_AY_Status_S', 0,1, 'value')

    @allure.title('Test DTC_IPB_Signal_Invalid by AWB_Available_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by AWB_Available_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_AWBAvailableS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x121', 20, 10, iStep, 'AWB_Available_S', 0,1, 'value')

    @allure.title('Test DTC_IPB_Signal_Invalid by AEB_not_Available_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by AEB_not_Available_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_AEBnotAvailableS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x121', 20, 10, iStep, 'AEB_not_Available_S', 0,1, 'value')

    @allure.title('Test DTC_IPB_Signal_Invalid by Prefill_Available_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by Prefill_Available_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_PrefillAvailableS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x121', 20, 10, iStep, 'Prefill_Available_S', 0,1, 'value')

    @allure.title('Test DTC_IPB_Signal_Invalid by ABAavailable_S out range in default session')
    @allure.description('Test DTC_IPB_Signal_Invalid by ABAavailable_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_IPB_Signal_Invalid_ABAavailableS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0x5C, 0x62, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'IPB_0x121', 20, 10, iStep, 'ABAavailable_S', 0,1, 'value')

    @allure.title('Test DTC_EPS_TIMEOUT by lost 0x11F message in default session')
    @allure.description('Test DTC_EPS_TIMEOUT by lost 0x11F message in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_TIMEOUT_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xC1, 0x34, 0x00]
        
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'EPS_0x11F', 10, 10, iStep)

    @allure.title('Test DTC_EPS_CRCC by 0x11F Checksum Error in default session')
    @allure.description('Test DTC_EPS_CRC by 0x11F Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_CRC_0x11F_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xC4,0x20,0x83]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x11F_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 100, 1)

        Driver['CAN'].set_0x11F_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 10, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_EPS_CRCC by 0x1FC Checksum Error in default session')
    @allure.description('Test DTC_EPS_CRC by 0x1FC Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_CRC_0x1FC_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xC4,0x20,0x83]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x1FC_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x1FC_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_EPS_CRCC by 0x24C Checksum Error in default session')
    @allure.description('Test DTC_EPS_CRC by 0x24C Checksum Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_CRC_0x24C_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xC4,0x20,0x83]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x24C_checksum_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 10000, 1)

        Driver['CAN'].set_0x24C_checksum_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 1000, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_EPS_ALC by 0x11F RollingCounter Error in default session')
    @allure.description('Test DTC_EPS_ALC by 0x11F RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_ALC_0x11F_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xC4,0x20,0x82]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x11F_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 100, 1)

        Driver['CAN'].set_0x11F_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 10, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_EPS_ALC by 0x1FC RollingCounter Error in default session')
    @allure.description('Test DTC_EPS_ALC by 0x1FC RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_ALC_0x1FC_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xC4,0x20,0x82]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x1FC_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 200, 1)

        Driver['CAN'].set_0x1FC_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 20, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_EPS_ALC by 0x24C RollingCounter Error in default session')
    @allure.description('Test DTC_EPS_ALC by 0x24C RollingCounter Error in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_ALC_0x24C_Default_Phy(self,action,BCMPower_Gear,Driver):
        req = [0x19,0x02,0x09]
        DTC_Number = [0xC4,0x20,0x82]

        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

        Driver['CAN'].set_0x24C_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 10000, 1)

        Driver['CAN'].set_0x24C_rolling_counter_error(False)
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 1000, 1)

        # 重启产品
        iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
        iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    @allure.title('Test DTC_EPS_Signal_Invalid by 0x11F Steering_Wheel_Angle_S out range in default session')
    @allure.description('Test DTC_EPS_Signal_Invalid by 0x11F Steering_Wheel_Angle_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_Signal_Invalid_SteeringWheelAngleS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xD0, 0x17, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'EPS_0x11F', 10, 10, iStep, 'Steering_Wheel_Angle_S', 780, 0, 'value')

    @allure.title('Test DTC_EPS_Signal_Invalid by 0x11F Steering_Wheel_Rotation_Speed_S out range in default session')
    @allure.description('Test DTC_EPS_Signal_Invalid by 0x11F Steering_Wheel_Rotation_Speed_S out range in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_Signal_Invalid_SteeringWheelRotationSpeed_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xD0, 0x17, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'EPS_0x11F', 10, 10, iStep, 'Steering_Wheel_Rotation_Speed_S', 1020, 0, 'value')

    @allure.title('Test Test DTC_EPS_Signal_Invalid by 0x11F Failure_Stats_OK_S wrong in default session')
    @allure.description('Test DTC_EPS_Signal_Invalid by 0x11F Failure_Stats_OK_S wrong in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_Signal_Invalid_FailureStatsOKS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xD0, 0x17, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'EPS_0x11F', 10, 10, iStep, 'Failure_Stats_OK_S', 0, 1, 'value')

    @allure.title('Test DTC_EPS_Signal_Invalid by 0x11F Sensor_Calibration_Stats_S wrong in default session')
    @allure.description('Test DTC_EPS_Signal_Invalid by 0x11F Sensor_Calibration_Stats_S wrong in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_Signal_Invalid_SensorCalibrationStatsS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xD0, 0x17, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'EPS_0x11F', 10, 10, iStep, 'Sensor_Calibration_Stats_S', 0, 1, 'value')

    @allure.title('Test DTC_EPS_Signal_Invalid by 0x1FC EPSAngleCtrlSt_S wrong in default session')
    @allure.description('Test DTC_EPS_Signal_Invalid by 0x1FC EPSAngleCtrlSt_S wrong in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_Signal_Invalid_EPSAngleCtrlStS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xD0, 0x17, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'EPS_0x1FC', 20, 10, iStep, 'EPSAngleCtrlSt_S', 4, 0, 'value')

    @allure.title('Test DTC_EPS_Signal_Invalid by 0x1FC StrngWhlTorqVD_S wrong in default session')
    @allure.description('Test DTC_EPS_Signal_Invalid by 0x1FC StrngWhlTorqVD_S wrong in default session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_DTC_EPS_Signal_Invalid_StrngWhlTorqVDS_Default_Phy(self, action,BCMPower_Gear, Driver):
        DTCNumber = [0xD0, 0x17, 0x86]
        iStep = 1
        iStep = self.checkDTC(Driver, DTCNumber, 'EPS_0x1FC', 20, 10, iStep, 'StrngWhlTorqVD_S', 0, 1, 'value')

    # '''空气悬架DTC'''
    # @allure.title('Test DTC_DiSus_Signal_Invalid by 0x258 DiSus_Height_Not_Calibration_S wrong in default session')
    # @allure.description('Test DTC_DiSus_Signal_Invalid by 0x258 DiSus_Height_Not_Calibration_S wrong in default session with physical addressing')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    # def test_DTC_DiSus_Signal_Invalid_Default_Phy(self, action,BCMPower_Gear, Driver):
    #     DTCNumber = [0xD0, 0x3F, 0x81]
    #     iStep = 1
    #     iStep = self.checkDTC(Driver, DTCNumber, 'DiSus_0x258', 100, 10, iStep, 'DiSus_Height_Not_Calibration_S', 1, 0, 'value')

    # @allure.title('Test DTC_DiSus_ALC by 0x258 RollingCounter Error in default session')
    # @allure.description('Test DTC_DiSus_ALC by 0x258 RollingCounter Error in default sessionin with physical addressing')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    # def test_DTC_DiSus_ALC_Default_Phy(self,action,BCMPower_Gear,Driver):
    #     req = [0x19,0x02,0x09]
    #     DTC_Number = [0xD0,0xF5,0x82]

    #     iStep = 1
    #     iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
    #     iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

    #     Driver['CAN'].set_0x258_rolling_counter_error(True)
    #     iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 1000, 1)

    #     Driver['CAN'].set_0x258_rolling_counter_error(False)
    #     iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

    #     # 重启产品
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

    #     iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

    #     iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
    #     iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    # @allure.title('Test DTC_DiSus_CRC by 0x258 Checksum Error in default session')
    # @allure.description('Test DTC_DiSus_CRC by 0x258 Checksum Error in default sessionin with physical addressing')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    # def test_DTC_DiSus_CRC_Default_Phy(self,action,BCMPower_Gear,Driver):
    #     req = [0x19,0x02,0x09]
    #     DTC_Number = [0xD1,0x3F,0x83]

    #     iStep = 1
    #     iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
    #     iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)

    #     Driver['CAN'].set_0x258_checksum_error(True)
    #     iStep = self.searchDTC(Driver, req, DTC_Number + [0x09], iStep, True, 1000, 1)

    #     Driver['CAN'].set_0x258_checksum_error(False)
    #     iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

    #     # 重启产品
    #     iStep = Driver['CAN'].restartMRR_Power(Driver,iStep)

    #     iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, True, 100, 1)

    #     iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x14,0xFF,0xFF,0xFF], [0x54], 1, iStep, False, 'UDS', 'noClearFault')
    #     iStep = self.searchDTC(Driver, req, DTC_Number + [0x08], iStep, False, 100, 1)

    # @allure.title('Test DTC_DiSus_TIMEOUT by lost 0x258 message in default session')
    # @allure.description('Test DTC_DiSus_TIMEOUT by lost 0x258 message in default session with physical addressing')
    # @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    # def test_DTC_DiSus_TIMEOUT_Default_Phy(self, action,BCMPower_Gear, Driver):
    #     DTCNumber = [0xD1, 0x2E, 0x87]
        
    #     iStep = 1
    #     iStep = self.checkDTC(Driver, DTCNumber, 'DiSus_0x258', 100, 10, iStep)

    
    @allure.title('Test power gear is off the failure occurred in default session')
    @allure.description('Test power gear is off the failure occurred in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_PowerGear_OFF_DTC_Default_Phy(self,action,Driver):
        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')
        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        Driver['CAN'].write_db_signal('Vehicle_CAN', Set_up.nodeName, 'Left_BCM_0x12D', 'BCMPower_Gear_12D_S', 1)
        time.sleep(3)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1001', '5001', 0, iStep)

        Driver['CAN'].set_0x11F_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, [0x19,0x02,0x09], [0xC4,0x20,0x82,0x09], iStep, False, 1000, 1)
        Driver['CAN'].set_0x11F_rolling_counter_error(False)
        iStep = self.clearDTC(Driver, iStep)

    @allure.title('Test power gear is acc the failure occurred in default session')
    @allure.description('Test power gear is acc the failure occurred in default sessionin with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_PowerGear_ACC_DTC_Default_Phy(self,action,Driver):
        iStep = 1
        iStep,uds_resp,size = Driver['CAN'].checkReqResp(Driver, [0x19,0x02,0x09], [0x59,0x02,0x09], 1, iStep, False, 'UDS', 'ClearFault')

        iStep = Driver['CAN'].delInitialFailure(iStep,uds_resp)
        Driver['CAN'].write_db_signal('Vehicle_CAN', Set_up.nodeName, 'Left_BCM_0x12D', 'BCMPower_Gear_12D_S', 2)
        time.sleep(3)
        iStep,uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1001', '5001', 0, iStep)

        Driver['CAN'].set_0x422_rolling_counter_error(True)
        iStep = self.searchDTC(Driver, [0x19,0x02,0x09], [0x5C,0x63,0x02,0x09], iStep, False, 1000, 1)
        Driver['CAN'].set_0x422_rolling_counter_error(False)
        iStep = self.clearDTC(Driver, iStep)